const readlindSync = require('readline-sync');//输入模块
const menu = require('./menu');//一级菜单
const scanfCheck = require('./scanfCheck');//输入检测
const addStudent = require('./addStudent');//添加学生
const addid = require('./addid');//添加学生查询id
const printScore = require('./printScore');//打印成绩单

module.exports = main;
function main(){
    let student;//存储学生数据
    let studentid;//存储学生查询id
    menu();
    let choice = readlindSync.question();
    // while(choice !== '1' && choice !== '2' && choice !== '3'){
    //     console.log('你是瞎吗？叫你输入1~3！');
    //     menu();
    //     choice = readlindSync.question();
    // }
    while(choice !== '3'){
        if(choice === '1'){
            student = addStudent();
        }else if(choice === '2'){
            studentid = addid();
            if(studentid){
                printScore(student,studentid);
            }
        }
        menu();
        choice = readlindSync.question();
    }
    console.log("欢迎使用小竹子二代系统！");
    
    return '玫瑰有刺，有人爱，有人哭！（hhhh）';
}
main();

